]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Hide notifications when the tray is summoned
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 20 May 2013 18:05:59 +0000 (14:05 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 20 May 2013 18:25:55 +0000 (14:25 -0400)
If the user summons the tray, it should take priority over a
notification showing.

https://bugzilla.gnome.org/show_bug.cgi?id=700639

js/ui/messageTray.js

index 28eef9294dbb5f954809250704b6b94bef02e480..fb3623e5562044d9c65d07ff629e015774c29f3e 100644 (file)
@@ -2218,8 +2218,10 @@ const MessageTray = new Lang.Class({
                                   !(this._notification && this._notification.focused) &&
                                   !this._pointerInNotification;
         let notificationLockedOut = !hasNotifications && this._notification;
-        let notificationMustClose = this._notificationRemoved || notificationLockedOut || (notificationExpired && this._userActiveWhileNotificationShown) || this._notificationClosed;
-        let canShowNotification = notificationsPending && this._trayState == State.HIDDEN;
+        let notificationMustClose = (this._notificationRemoved || notificationLockedOut ||
+                                     (notificationExpired && this._userActiveWhileNotificationShown) ||
+                                     this._notificationClosed || this._traySummoned);
+        let canShowNotification = notificationsPending && this._trayState == State.HIDDEN && !this._traySummoned;
 
         if (this._notificationState == State.HIDDEN) {
             if (canShowNotification)
@@ -2233,8 +2235,6 @@ const MessageTray = new Lang.Class({
                 this._ensureNotificationFocused();
         }
 
-        let mustHideTray = this._notificationState != State.HIDDEN || !hasNotifications;
-
         // Summary notification
         let haveClickedSummaryItem = this._clickedSummaryItem != null;
         let summarySourceIsMainNotificationSource = (haveClickedSummaryItem && this._notification &&
@@ -2264,7 +2264,7 @@ const MessageTray = new Lang.Class({
         // Tray itself
         let trayIsVisible = (this._trayState == State.SHOWING ||
                              this._trayState == State.SHOWN);
-        let trayShouldBeVisible = this._traySummoned && !this._keyboardVisible && !mustHideTray;
+        let trayShouldBeVisible = this._traySummoned && !this._keyboardVisible && hasNotifications;
         if (!trayIsVisible && trayShouldBeVisible)
             trayShouldBeVisible = this._showTray();
         else if (trayIsVisible && !trayShouldBeVisible)